htb
How can i do the following: i have 100 kb leased line. I have 2 ips in my network 1) 1.2.3.1 2) 1.2.3.2 , i gave all of them 100 kbps, but if 1.2.3.1 needs 80 kb, and 1.2.3.2 downlloads with 90, 1.2.3.1 must get 80 kb, and 1.2.3.2 continue download with 10 kbps.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
If 1.2.3.1 is absolute priority you should use the prio qdisc and put in a filter that brings 1.2.3.1's traffic to a band with higher priority (read the LARTC HOWTO in http://lartc.org/ ). If you want to give 1.2.3.2 minimum bandwidth to use (like 10 kbps) then I recommend HTB (
http://luxik.cdi.cz/~devik/qos/htb/ ) but you must patch both kernel and tc.
In either case or if you decide to use anything else you should understand the problem domain. Start with readning LARTC-HOWTO.
----- Original Message -----
From: "George Tsuladze" <[email protected]>
To: <[email protected]>
Sent: Wednesday, March 20, 2002 10:43 AM
Subject: [LARTC] htb
Quoted 9 lines
How can i do the following: i have 100 kb leased line. I have 2 ips in my network 1) 1.2.3.1 2) 1.2.3.2 , i gave all of them 100 kbps, but if 1.2.3.1 needs 80 kb, and 1.2.3.2 downlloads with 90, 1.2.3.1 must get 80 kb, and 1.2.3.2 continue download with 10 kbps.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 3 lines · Anjaneya Pal
hi,
i'm hearing a lot abt htb. can ne'one plz tell me wht is htb? and wht does it do?
You can use it in stead of CBQ to manage the available bandwidth. You can create a setup where hosts/services/traffic-flows can borrow bandwidth from each other and where you can specify minimum bandwidths
Stef
Signature · 7 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] HTB
In reply to George TsuladzeHi guys,
How to put HTB in to 2.4 kernel?
Thanks in advance
Rimas
[LARTC] HTB
In reply to George TsuladzeHi guys,
How to put HTB in to 2.4 kernel?
Thanks in advance
Rimas
Re: [LARTC] HTB
In reply to George TsuladzeOn Tuesday 24 September 2002 16:12, Rimas wrote:
Hi Rimas,
Quoted 1 line
How to put HTB in to 2.4 kernel?
patching? :)
If you wanna try 3.6 code, download the tgz, untargzip it (tar xzpf) and you'll see a diff/patch. Just "patch -p1 --dry-run < patchname" and see if it succeed, if, leave out --dry-run, if not, fix the errors. If you have questions when errors occur, don't hesitate to ask.
for HTB2 code, just download the patch and follow the same as above (patch -p1 ...)
http://luxik.cdi.cz/~devik/qos/htb/
Signature · 13 lines
Kind regards
Marc-Christian Petersen
http://sourceforge.net/projects/wolk
PGP/GnuPG Key: 1024D/569DE2E3DB441A16
Fingerprint: 3469 0CF8 CA7E 0042 7824 080A 569D E2E3 DB44 1A16
Key available at www.keyserver.net. Encrypted e-mail preferred.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/Re: [LARTC] HTB
In reply to George TsuladzeQuoted 3 lines · Rimas
Hi guys,
How to put HTB in to 2.4 kernel?
Compile kernel 2.4.20 with HTB support.
Or else get kernel patches for 2.4.x (or 2.2.x) from devik's homepage.
Signature · 5 lines
Esteban A. Maringolo Secont, Comunicaciones Digitales Buenos Aires, Argentina Tel: +54 (11) 4551-2455 http://www.secont.com.ar/
Re: [LARTC] HTB
In reply to George TsuladzeThank you guys
Rimas
----- Original Message -----
From: Rimas
To: [email protected]
Sent: Tuesday, September 24, 2002 3:12 PM
Subject: [LARTC] HTB
Hi guys,
How to put HTB in to 2.4 kernel?
Thanks in advance
Rimas
Re: [LARTC] HTB
In reply to George TsuladzeI tried the "patch -p1 --dry-run ./htb3.6_2.4.17.diff" but nothing happened, no error message, nothing.
Rimas
----- Original Message -----
From: "Marc-Christian Petersen" <[email protected]>
To: <[email protected]>
Cc: "Rimas" <[email protected]>
Sent: Tuesday, September 24, 2002 3:17 PM
Subject: Re: [LARTC] HTB
Quoted 9 lines · Rimas
Hi Rimas,
Quoted 1 line
How to put HTB in to 2.4 kernel?
patching? :)
If you wanna try 3.6 code, download the tgz, untargzip it (tar xzpf) and you'll see a diff/patch. Just "patch -p1 --dry-run < patchname" and see if
it
Quoted 4 lines
succeed, if, leave out --dry-run, if not, fix the errors. If you have questions when errors occur, don't hesitate to ask.
for HTB2 code, just download the patch and follow the same as above
(patch -p1
Quoted 8 lines
...)
http://luxik.cdi.cz/~devik/qos/htb/
--
Kind regards
Marc-Christian Petersen
Quoted 7 lines
http://sourceforge.net/projects/wolk
PGP/GnuPG Key: 1024D/569DE2E3DB441A16
Fingerprint: 3469 0CF8 CA7E 0042 7824 080A 569D E2E3 DB44 1A16 Key available at www.keyserver.net. Encrypted e-mail preferred.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeOn Tuesday 24 September 2002 16:55, Rimas wrote:
Hi Rimas,
Quoted 2 lines
I tried the "patch -p1 --dry-run ./htb3.6_2.4.17.diff" but nothing happened, no error message, nothing.
err, you forget < !
Look carefully to what I've posted :)
root@codeman:[/usr/src/linux-2.4.18-vanilla] # patch -p1 --dry-run < htb2_2.4.17.diff
patching file net/sched/Config.in
patching file net/sched/Makefile
patching file net/sched/sch_htb.c
patching file include/linux/pkt_sched.h
patching file net/sched/sch_api.c
Signature · 11 lines
Kind regards
Marc-Christian Petersen
http://sourceforge.net/projects/wolk
PGP/GnuPG Key: 1024D/569DE2E3DB441A16
Fingerprint: 3469 0CF8 CA7E 0042 7824 080A 569D E2E3 DB44 1A16
Key available at www.keyserver.net. Encrypted e-mail preferred.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/Re: [LARTC] HTB
In reply to George TsuladzeHi again,
Sorry it was my mistake, I have mised <.
And I got a few error messages :
patching file net/sched/Config.in
patching file net/sched/Makefile
patching file net/sched/sch_htb.c
patching file include/linux/pkt_sched.h
patching file net/sched/sch_api.c
Hunk #1 FAILED at 1117.
1 out of 2 hunks FAILED -- saving rejects to file net/sched/sch_api.c.rej patching file lib/Makefile
Reversed (or previously applied) patch detected! Assume -R? [n] y patching file lib/rbtree.c
Reversed (or previously applied) patch detected! Assume -R? [n] y patching file include/net/pkt_sched.h
Reversed (or previously applied) patch detected! Assume -R? [n] y Hunk #1 succeeded at 222 (offset 1 line).
Is it OK or no?
I use RedHat 7.3 and kernel 2.4.19 and do I have to update iproute2 too ?
Thank you
Rimas
----- Original Message -----
From: "Marc-Christian Petersen" <[email protected]>
To: <[email protected]>
Cc: "Rimas" <[email protected]>
Sent: Tuesday, September 24, 2002 4:00 PM
Subject: Re: [LARTC] HTB
Quoted 10 lines · Rimas
Hi Rimas,
Quoted 2 lines
I tried the "patch -p1 --dry-run ./htb3.6_2.4.17.diff" but nothing happened, no error message, nothing.
err, you forget < !
Look carefully to what I've posted :)
Quoted 21 lines
root@codeman:[/usr/src/linux-2.4.18-vanilla] # patch -p1 --dry-run < htb2_2.4.17.diff
patching filenet/sched/Config.in
patching filenet/sched/Makefile
patching filenet/sched/sch_htb.c
patching fileinclude/linux/pkt_sched.h
patching filenet/sched/sch_api.cSignature · 11 lines
Kind regards Marc-Christian Petersen http://sourceforge.net/projects/wolk PGP/GnuPG Key: 1024D/569DE2E3DB441A16 Fingerprint: 3469 0CF8 CA7E 0042 7824 080A 569D E2E3 DB44 1A16 Key available at www.keyserver.net. Encrypted e-mail preferred. _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeHi again,
Sorry it was my mistake, I have mised <.
And I got a few error messages :
patching file net/sched/Config.in
patching file net/sched/Makefile
patching file net/sched/sch_htb.c
patching file include/linux/pkt_sched.h
patching file net/sched/sch_api.c
Hunk #1 FAILED at 1117.
1 out of 2 hunks FAILED -- saving rejects to file net/sched/sch_api.c.rej patching file lib/Makefile
Reversed (or previously applied) patch detected! Assume -R? [n] y patching file lib/rbtree.c
Reversed (or previously applied) patch detected! Assume -R? [n] y patching file include/net/pkt_sched.h
Reversed (or previously applied) patch detected! Assume -R? [n] y Hunk #1 succeeded at 222 (offset 1 line).
Is it OK or no?
I use RedHat 7.3 and kernel 2.4.19 and do I have to update iproute2 too ?
Thank you
Rimas
----- Original Message -----
From: "Marc-Christian Petersen" <[email protected]>
To: <[email protected]>
Cc: "Rimas" <[email protected]>
Sent: Tuesday, September 24, 2002 4:00 PM
Subject: Re: [LARTC] HTB
Quoted 10 lines · Rimas
Hi Rimas,
Quoted 2 lines
I tried the "patch -p1 --dry-run ./htb3.6_2.4.17.diff" but nothing happened, no error message, nothing.
err, you forget < !
Look carefully to what I've posted :)
Quoted 21 lines
root@codeman:[/usr/src/linux-2.4.18-vanilla] # patch -p1 --dry-run < htb2_2.4.17.diff
patching filenet/sched/Config.in
patching filenet/sched/Makefile
patching filenet/sched/sch_htb.c
patching fileinclude/linux/pkt_sched.h
patching filenet/sched/sch_api.cSignature · 11 lines
Kind regards Marc-Christian Petersen http://sourceforge.net/projects/wolk PGP/GnuPG Key: 1024D/569DE2E3DB441A16 Fingerprint: 3469 0CF8 CA7E 0042 7824 080A 569D E2E3 DB44 1A16 Key available at www.keyserver.net. Encrypted e-mail preferred. _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeQuoted 7 lines · Stef Coene
Quoted 5 lines · Esteban Maringolo
Quoted 1 line · Rimas
How to put HTB in to 2.4 kernel?
Compile kernel 2.4.20 with HTB support.
Kernel 2.4.20 has htb builtin.
That's why I've said "compile" and not "patch". :-)
Signature · 5 lines
Esteban A. Maringolo Secont, Comunicaciones Digitales Buenos Aires, Argentina Tel: +54 (11) 4551-2455 http://www.secont.com.ar/
Re: [LARTC] HTB
In reply to George TsuladzeQuoted 10 lines · Esteban Maringolo
Quoted 7 lines · Stef Coene
Quoted 4 lines · Esteban Maringolo
Quoted 1 line · Rimas
How to put HTB in to 2.4 kernel?
Compile kernel 2.4.20 with HTB support.
Kernel 2.4.20 has htb builtin.
That's why I've said "compile" and not "patch". :-)
:)
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeQuoted 5 lines · Rimas
Hi again,
Sorry it was my mistake, I have mised <.
And I got a few error messages :
Quoted 9 lines
patching file
net/sched/Config.in
patching filenet/sched/Makefile
patching filenet/sched/sch_htb.c
patching fileinclude/linux/pkt_sched.h
patching filenet/sched/sch_api.c
Hunk #1 FAILED at 1117.
1 out of 2 hunks FAILED -- saving rejects to filenet/sched/sch_api.c.rejpatching file lib/Makefile
Reversed (or previously applied) patch detected! Assume -R? [n] y
^^^^
Quoted 2 lines
patching file
lib/rbtree.c
Reversed (or previously applied) patch detected! Assume -R? [n] y
^^^^
Quoted 2 lines
patching file
include/net/pkt_sched.h
Reversed (or previously applied) patch detected! Assume -R? [n] y
^^^^
Quoted 1 line
Hunk #1 succeeded at 222 (offset 1 line).
why did you reverse the patch?
Re: [LARTC] HTB
In reply to George TsuladzeQuoted 20 lines · Rimas
Hi again,
Sorry it was my mistake, I have mised <.
And I got a few error messages :patching file
net/sched/Config.in
patching filenet/sched/Makefile
patching filenet/sched/sch_htb.c
patching fileinclude/linux/pkt_sched.h
patching filenet/sched/sch_api.c
Hunk #1 FAILED at 1117.
1 out of 2 hunks FAILED -- saving rejects to filenet/sched/sch_api.c.rejpatching file lib/Makefile
Reversed (or previously applied) patch detected! Assume -R? [n] y patching filelib/rbtree.c
Reversed (or previously applied) patch detected! Assume -R? [n] y patching fileinclude/net/pkt_sched.h
Reversed (or previously applied) patch detected! Assume -R? [n] y Hunk #1 succeeded at 222 (offset 1 line).
Quoted 1 line
Is it OK or no?
Nop. You have to choose "n". Some general clean-up patches that are in the htb patch are already applied to the defaul tkernel.
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeMandrake 2.4.19mdk has HTB in, probably RedHat have done the same ...
"Rimas" <[email protected]> wrote:
|Hi again, | |Sorry it was my mistake, I have mised <. |And I got a few error messages : | |patching file net/sched/Config.in |patching file net/sched/Makefile |patching file net/sched/sch_htb.c |patching file include/linux/pkt_sched.h |patching file net/sched/sch_api.c |Hunk #1 FAILED at 1117. |1 out of 2 hunks FAILED -- saving rejects to file net/sched/sch_api.c.rej |patching file lib/Makefile |Reversed (or previously applied) patch detected! Assume -R? [n] y |patching file lib/rbtree.c |Reversed (or previously applied) patch detected! Assume -R? [n] y |patching file include/net/pkt_sched.h |Reversed (or previously applied) patch detected! Assume -R? [n] y |Hunk #1 succeeded at 222 (offset 1 line). | |Is it OK or no? | |I use RedHat 7.3 and kernel 2.4.19 and do I have to update iproute2 too ? | |Thank you | |Rimas | | |----- Original Message ----- |From: "Marc-Christian Petersen" <[email protected]> |To: <[email protected]> |Cc: "Rimas" <[email protected]> |Sent: Tuesday, September 24, 2002 4:00 PM |Subject: Re: [LARTC] HTB | | |> On Tuesday 24 September 2002 16:55, Rimas wrote: |> |> Hi Rimas, |> |> > I tried the "patch -p1 --dry-run ./htb3.6_2.4.17.diff" but nothing |> > happened, no error message, nothing. |> err, you forget < ! |> |> Look carefully to what I've posted :) |> |> root@codeman:[/usr/src/linux-2.4.18-vanilla] # patch -p1 --dry-run < |> htb2_2.4.17.diff |> patching file net/sched/Config.in |> patching file net/sched/Makefile |> patching file net/sched/sch_htb.c |> patching file include/linux/pkt_sched.h |> patching file net/sched/sch_api.c |> |> --
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeDear Rimas,
I think you trying to remove any qdisc already present on your egress queue.
If you have not created any qdisc before trying to remove it, then defn't it will give such error.
You need to redirect it to /dev/null. if you trying to do the same before creating the root qdisc.
shekhar
Quoted 59 lines · Rimas
shekhar,
Quoted 1 line
Make sure you had enable the HTB support in Kernel for Fair Queuing.
I did it.
When I look to htb-start (debug file) I seethe error message only in one place:
# Fri Nov 8 10:56:35 GMT 2002
# ip link show 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: shaper0: <> mtu 1500 qdisc noop qlen 10 link/ether 3: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:50:04:6c:3c:5b brd ff:ff:ff:ff:ff:ff 4: eth1: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:50:da:3c:d9:8b brd ff:ff:ff:ff:ff:ff 5: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:04:e2:26:3d:80 brd ff:ff:ff:ff:ff:ff# tc qdisc del dev eth0 root RTNETLINK answers: No such file or directory ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # tc qdisc add dev eth0 root handle 1 htb default 30 r2q 100# ip link show 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: shaper0: <> mtu 1500 qdisc noop qlen 10 link/ether 3: eth0: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc htb qlen 100 link/ether 00:50:04:6c:3c:5b brd ff:ff:ff:ff:ff:ff 4: eth1: <BROADCAST,MULTICAST,PROMISC,UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:50:da:3c:d9:8b brd ff:ff:ff:ff:ff:ff 5: eth2: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 100 link/ether 00:04:e2:26:3d:80 brd ff:ff:ff:ff:ff:ff# tc class add dev eth0 parent 1: classid 1:2 htb rate 5Mbit burst 15k# tc class add dev eth0 parent 1:2 classid 1:10 htb rate 5Mbit burst 15k# tc qdisc add dev eth0 parent 1:10 handle 10 sfq perturb 10# tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip sport 80 0xffff classid 1:10# tc class add dev eth0 parent 1:2 classid 1:20 htb rate 3Mbit ceil 5Mbit burst 15k# tc qdisc add dev eth0 parent 1:20 handle 20 sfq perturb 10# tc filter add dev eth0 parent 1:0 protocol ip prio 100 u32 match ip dport 25 0xffff classid 1:20# tc class add dev eth0 parent 1:2 classid 1:30 htb rate 1Kbit ceil 5Mbit burst 15k
Quoted 8 lines
# tc qdisc add dev eth0 parent 1:30 handle 30 sfq perturb 10Any ideas?
Thnak you
Rimas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] HTB
In reply to George TsuladzeHi guys..
Running HTB on leaf bearing 1.0-stable with kernel 2.4.20
For some reason, I'm getting these messages in my SYSLOG
Dec 27 18:21:12 gw-homenet kernel: htb*r3 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*r2 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*r1 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*r0 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*c10011 m=2 t=391999 c=100352 pq=0 df=0 ql=0 pa=0 f: Dec 27 18:21:12 gw-homenet kernel: htb*c10001 m=2 t=83725 c=83725 pq=0 df=0 ql=0 pa=0 f: Dec 27 18:21:12 gw-homenet kernel: htb*c10010 m=2 t=130400 c=88341 pq=0 df=229376 ql=0 pa=0 f: Dec 27 18:21:12 gw-homenet kernel: htb*c10012 m=2 t=577066 c=168099 pq=0 df=60000000 ql=0 pa=0 f: Dec 27 18:21:12 gw-homenet kernel: htb*g j=145034 Dec 27 18:21:12 gw-homenet kernel: htb*r7 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*r6 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*r5 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*r4 m=0 Dec 27 18:21:12 gw-homenet kernel: htb*r3 m=0 Dec 27 18:21:13 gw-homenet kernel: htb*r2 m=0 Dec 27 18:21:13 gw-homenet kernel: htb*r1 m=0 Dec 27 18:21:13 gw-homenet kernel: htb*r0 m=0 Dec 27 18:21:13 gw-homenet kernel: htb*c10011 m=2 t=391999 c=100352 pq=0 df=0 ql=0 pa=0 f: Dec 27 18:21:13 gw-homenet kernel: htb*c10001 m=2 t=83725 c=83725 pq=0 df=0 ql=0 pa=0 f: Dec 27 18:21:13 gw-homenet kernel: htb*c10010 m=2 t=130400 c=88341 pq=0 df=229376 ql=0 pa=0 f: Dec 27 18:21:13 gw-homenet kernel: htb*c10012 m=2 t=577066 c=168099 pq=0 df=60000000 ql=0 pa=0 f: Dec 27 18:21:13 gw-homenet kernel: htb*g j=145037
This is my start file -- this is being started from Shorewall Firewall run_tc qdisc add dev eth1 root handle 1: htb default 10 run_tc class add dev eth1 parent 1: classid 1:1 htb rate 122kbit ceil 122kbit
echo " Added Top Level Class -- rate 122kbit"
run_tc class add dev eth1 parent 1:1 classid 1:10 htb rate 80kbit ceil 122kbit prio 0run_tc class add dev eth1 parent 1:1 classid 1:11 htb rate 24kbit ceil 100kbit prio 1run_tc class add dev eth1 parent 1:1 classid 1:12 htb rate 18kbit ceil 64kbit prio 2
echo " Added Second Level Classes -- rates 80kbit, 24kbit, 18kbit"
run_tc qdisc add dev eth1 parent 1:10 handle 120: sfq perturb 10 run_tc qdisc add dev eth1 parent 1:11 handle 130: sfq perturb 10 run_tc qdisc add dev eth1 parent 1:12 handle 140: sfq perturb 10
echo " Enabled SFQ on Second Level Classes"
run_tc filter add dev eth1 parent 1: protocol ip prio 0 handle 1 fw classid 1:10run_tc filter add dev eth1 parent 1: protocol ip prio 1 handle 2 fw classid 1:11run_tc filter add dev eth1 parent 1: protocol ip prio 2 handle 3 fw classid 1:12
echo " Defined fwmark filters"
During the startup of my Linux box, I see this message in the Syslog, which I assume, is generated, when the sch_htb module is being load
Dec 27 18:02:10 gw-homenet kernel: HTB: quantum of class 10011 is small.
Consider r2q change.<4>HTB: quantum of class 10012 is small. Consider r2q change
Any suggestions will be appreciated, thnks
__________________________________________________________________
Reginald Richardson
ICQ#: 365841
Current ICQ status:
+ More ways to contact me
__________________________________________________________________
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeQuoted 5 lines
Dec 27 18:02:10 gw-homenet kernel: HTB: quantum of class 10011 is small.Consider r2q change.<4>HTB: quantum of class 10012 is small. Consider r2q change
Any suggestions will be appreciated, thnks
The famous quantum question :)
I have more info on the faq page on www.docum.org
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
class htb 1000:10 root leaf 1010: prio 0 quantum 1600 rate 48Mbit ceil 48Mbit burst 3Kb/8 mpu 0b cburst 63Kb/8 mpu 0b level 0
Sent 17553816503 bytes 13078592 pkts (dropped 63733, overlimits 0) rate 730783bps 570pps backlog 112p
lended: 13078480 borrowed: 0 giants: 0
tokens: -589 ctokens: 7412
Hi!
Can somebody explain what is wrong from the above?
I can't understand following relation:
"rate 48Mbit ceil 48Mbit" and "rate 730783bps 570pps backlog 112p" Why the current rate is limited to 730KByte/s (and there is backlog 112p) when the rate and ceil are 48Mbit/s (6Mbyte/s)?
I sent similar question some months ago, but there was no answer.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 7 lines · Evgeni Gechev
class htb 1000:10 root leaf 1010: prio 0 quantum 1600 rate 48Mbit ceil 48Mbit burst 3Kb/8 mpu 0b cburst 63Kb/8 mpu 0b level 0
Sent 17553816503 bytes 13078592 pkts (dropped 63733, overlimits 0) rate 730783bps 570pps backlog 112p
lended: 13078480 borrowed: 0 giants: 0
tokens: -589 ctokens: 7412
Quoted 6 lines
Hi!
Can somebody explain what is wrong from the above?
I can't understand following relation:
"rate 48Mbit ceil 48Mbit" and "rate 730783bps 570pps backlog 112p" Why the current rate is limited to 730KByte/s (and there is backlog 112p) when the rate and ceil are 48Mbit/s (6Mbyte/s)?
rate 730783bps means that the average rate is 730783bps for that class. And 570pps means that class sends 570 packets per seconds. So it's just some statistics for that class.
I'm not sure for the backlog, but I think it means that there are 112 packets in the queue ready to be send.
Quoted 1 line
I sent similar question some months ago, but there was no answer.
Satisfied ? :)
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 27 lines · Stef Coene
Quoted 7 lines · Evgeni Gechev
class htb 1000:10 root leaf 1010: prio 0 quantum 1600 rate 48Mbit ceil 48Mbit burst 3Kb/8 mpu 0b cburst 63Kb/8 mpu 0b level 0
Sent 17553816503 bytes 13078592 pkts (dropped 63733, overlimits 0) rate 730783bps 570pps backlog 112p
lended: 13078480 borrowed: 0 giants: 0
tokens: -589 ctokens: 7412Quoted 6 lines
Hi!
Can somebody explain what is wrong from the above?
I can't understand following relation:
"rate 48Mbit ceil 48Mbit" and "rate 730783bps 570pps backlog 112p" Why the current rate is limited to 730KByte/s (and there is backlog 112p) when the rate and ceil are 48Mbit/s (6Mbyte/s)?rate 730783bps means that the average rate is 730783bps for that class. And 570pps means that class sends 570 packets per seconds. So it's just some statistics for that class.
I'm not sure for the backlog, but I think it means that there are 112 packets in the queue ready to be send.Quoted 1 line
I sent similar question some months ago, but there was no answer.
Satisfied ? :)
Stef
--
Quoted 8 lines
[email protected]
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Satisfied :)
But partially :(
The problem is that the bandwidth is REALLY limited to about 730kbps. And isn't the backlog the number of packets, delayed due to bandwidth reached the shaper limit?
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 3 lines
Satisfied :)
But partially :(
The problem is that the bandwidth is REALLY limited to about 730kbps.
Then your class reaches it's limit. But why do you have a ceil of 48Mbps and 730kbps?
Quoted 2 lines
And isn't the backlog the number of packets, delayed due to bandwidth reached the shaper limit?
Or like I said, there are packets in the queue ready to be send but they can't due to limited link bandwidth.
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 6 lines · Stef Coene
Quoted 3 lines
Satisfied :)
But partially :(
The problem is that the bandwidth is REALLY limited to about 730kbps.Then your class reaches it's limit. But why do you have a ceil of 48Mbps and 730kbps?
Exactly. Why?
I can't find out.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 10 lines · Evgeni Gechev
Quoted 6 lines · Stef Coene
Quoted 3 lines
Satisfied :)
But partially :(
The problem is that the bandwidth is REALLY limited to about 730kbps.Then your class reaches it's limit. But why do you have a ceil of 48Mbps and 730kbps?
Exactly. Why?
I can't find out.
What's the command you used to create that class?
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 13 lines · Stef Coene
Quoted 10 lines · Evgeni Gechev
Quoted 6 lines · Stef Coene
Quoted 3 lines
Satisfied :)
But partially :(
The problem is that the bandwidth is REALLY limited to about 730kbps.Then your class reaches it's limit. But why do you have a ceil of 48Mbps and 730kbps?
Exactly. Why?
I can't find out.What's the command you used to create that class?
Quoted 8 lines
Stef
--
[email protected]
"Using Linux as bandwidth manager"
http://www.docum.org/
#lartc @ irc.oftc.net
Simple configuration:
test1:
root@mail:~# tc qdisc add dev eth1 root handle 1000: htb
root@mail:~# tc class add dev eth1 parent 1000: classid 1000:10 htb rate 5Mbit
ceil 5Mbit burst 3k quantum 1600
root@mail:~# tc filter add dev eth1 protocol ip prio 100 u32 match ip dst
0.0.0.0/0 flowid 1000:10
root@mail:~# ifstat -i eth1
eth1
KB/s in KB/s out
43.84 631.32
43.46 627.32
43.71 627.99
43.27 626.35
43.72 627.36
43.59 628.03
43.62 627.17
43.96 627.22
43.43 627.81
43.83 627.54test2:
root@mail:~# tc qdisc add dev eth1 root handle 1000: htb
root@mail:~# tc class add dev eth1 parent 1000: classid 1000:10 htb rate 6Mbit
ceil 6Mbit burst 3k quantum 1600
root@mail:~# tc filter add dev eth1 protocol ip prio 100 u32 match ip dst
0.0.0.0/0 flowid 1000:10
root@mail:~# ifstat -i eth1
eth1
KB/s in KB/s out
45.46 651.63
45.06 651.58
45.02 651.49
45.22 647.36
45.14 652.95
45.31 651.22
45.29 650.39
44.96 650.34
45.13 651.30
45.16 651.42test3:
root@mail:~# tc qdisc add dev eth1 root handle 1000: htb
root@mail:~# tc class add dev eth1 parent 1000: classid 1000:10 htb rate 50Mbit
ceil 50Mbit burst 3k quantum 1600
root@mail:~# tc filter add dev eth1 protocol ip prio 100 u32 match ip dst
0.0.0.0/0 flowid 1000:10
root@mail:~# ifstat -i eth1
eth1
KB/s in KB/s out
45.04 655.73
44.75 644.21
45.16 651.51
45.36 652.94
44.28 650.62
45.15 651.90
44.91 651.28
45.21 651.69
44.66 651.25
45.16 650.84_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Quoted 9 lines
Simple configuration:
test1:
root@mail:~# tc qdisc add dev eth1 root handle 1000: htb root@mail:~# tc class add dev eth1 parent 1000: classid 1000:10 htb rate 5Mbit ceil 5Mbit burst 3k quantum 1600 root@mail:~# tc filter add dev eth1 protocol ip prio 100 u32 match ip dst 0.0.0.0/0 flowid 1000:10
Your burst is too low. If you don't specify it, htb will calculate the minimum burst for you.
Stef
Signature · 8 lines
[email protected] "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.oftc.net _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] HTB
In reply to George TsuladzeHi, I have the following questions:
I only have one htb computer (2 nics) to shape the international traffic as well as the metropolitan traffic (i have a list of metropolitan ip's to use). Can this be achived using iptables with packet marking (on that htb computer the 2 nics are bridged)?
If it can will there be delays introduced by the shaping operation (the metropolitan link is a 100M fiber - full almost all the time)???
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeCristea, you are too vague in your question. I can tell you that you can shape MAN and WAN traffic separately using diferent classes and filters.
100Mbits for a single machine looks like too much traffic. Maybe you should divide load between more machines and have redundancy in your setup.
If this is not what you meant, please let us know...
Andre
Quoted 13 lines · Cristea Virgil Ionut
Hi, I have the following questions:
I only have one htb computer (2 nics) to shape the international traffic as well as the metropolitan traffic (i have a list of metropolitan ip's to use). Can this be achived using iptables with packet marking (on that htb computer the 2 nics are bridged)?
If it can will there be delays introduced by the shaping operation (the metropolitan link is a 100M fiber - full almost all the time)???
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] HTB
In reply to George TsuladzeHello,
I have problems with htb. The problem is that when I download any file via shaper with htb, the traffic is very dinamic, it jumps, for example:
if i have set ceil = 128kbit the results that it jumps from 112kbps to 144kbps or smth like that maybe its not very bad, but when the traffic drops down to 40kbps or less and then after 1 or 2 seconds jumps to 144kbps, its bad :-( and it is often.
Root class is 20Mbit
There are about 7000 classes (on two interfaces)
an example script:
===============================================#!/bin/sh
TC="/sbin/tc"
INT_IF="eth1"
EXT_IF="eth0"
$TC qdisc del dev $INT_IF root
$TC qdisc del dev $EXT_IF root
$TC qdisc add dev $INT_IF root handle 1: htb r2q 1 default 2000 # tried default r2q $TC qdisc add dev $EXT_IF root handle 1: htb r2q 1 default 2000
$TC class add dev $INT_IF parent 1: classid 1:1 htb quantum 60000 rate 20Mbit ceil 20Mbit
$TC class add dev $EXT_IF parent 1: classid 1:1 htb quantum 40000 rate 20Mbit ceil 20Mbit
$TC class add dev $INT_IF parent 1:1 classid 1:2000 htb quantum 1500 rate 1kbit ceil 5kbit
$TC class add dev $EXT_IF parent 1:1 classid 1:2000 htb quantum 1500 rate 1kbit ceil 5kbit
$TC qdisc add dev $INT_IF parent 1:2000 handle 2000: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2000 handle 2000: sfq perturb 10
$TC class add dev $INT_IF parent 1:1 classid 1:2001 htb quantum 60000 rate 682kbit ceil 2048kbit # tried to let htb itself calculate quantum, the same $TC class add dev $EXT_IF parent 1:1 classid 1:2001 htb quantum 60000 rate 682kbit ceil 2048kbit
$TC qdisc add dev $INT_IF parent 1:2001 handle 2001: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2001 handle 2001: sfq perturb 10
$TC filter add dev $INT_IF protocol ip parent 1:0 prio 1 u32 match ip dst x.x.x.x flowid 1:2001
$TC filter add dev $EXT_IF protocol ip parent 1:0 prio 1 u32 match ip src x.x.x.x flowid 1:2001
$TC class add dev $INT_IF parent 1:1 classid 1:2002 htb quantum 1500 rate 42kbit ceil 128kbit
$TC class add dev $EXT_IF parent 1:1 classid 1:2002 htb quantum 1500 rate 42kbit ceil 128kbit
$TC qdisc add dev $INT_IF parent 1:2002 handle 2002: sfq perturb 10
$TC qdisc add dev $EXT_IF parent 1:2002 handle 2002: sfq perturb 10
$TC filter add dev $INT_IF protocol ip parent 1:0 prio 1 u32 match ip dst x.x.x.x flowid 1:2002
$TC filter add dev $EXT_IF protocol ip parent 1:0 prio 1 u32 match ip src x.x.x.x flowid 1:2002
================================================
linux 2.4.25
network cards: eepro100
HTB 3
Xeon 2.4GHz
Maybe I need to tune kernel, HZ or smth?
sorry for bad english
--
Arturas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] HTB
In reply to George TsuladzeHi all
I'm new in this list and i hope to lear and to help if possible.
But firt i need help :-(
I have this messege in my syslog when my classes and qdiscs goes down.
Can any one know what does it mean?
Thnx in advance.
Yannick Arrimadas Bot
Oct 14 16:09:27 pototogorri kernel: HTB init, kernel part version 3.17 Oct 14 16:09:27 pototogorri kernel: Unable to handle kernel paging request at virtual address 00100100 Oct 14 16:09:27 pototogorri kernel: printing eip: Oct 14 16:09:27 pototogorri kernel: c0267fb4 Oct 14 16:09:27 pototogorri kernel: *pde = 00000000 Oct 14 16:09:27 pototogorri kernel: Oops: 0000 [#1] Oct 14 16:09:27 pototogorri kernel: Modules linked in: cls_fw sch_sfq sch_htb ipt_MARK iptable_mangle ide_floppy ide_tape sg sr_mod ide_cd cd Oct 14 16:09:27 pototogorri kernel: CPU: 0 Oct 14 16:09:27 pototogorri kernel: EIP: 0060:[<c0267fb4>] Not tainted Oct 14 16:09:27 pototogorri kernel: EFLAGS: 00010206 (2.6.8.1) Oct 14 16:09:27 pototogorri kernel: EIP is at qdisc_lookup+0x34/0x50 Oct 14 16:09:27 pototogorri kernel: eax: 001000d4 ebx: 001000d4 ecx: dd3f7914 edx: 00100100 Oct 14 16:09:27 pototogorri kernel: esi: 00010000 edi: 00010000 ebp: c204dc38 esp: c204dc30 Oct 14 16:09:27 pototogorri kernel: ds: 007b es: 007b ss: 0068 Oct 14 16:09:27 pototogorri kernel: Process tc (pid: 22899, threadinfoÂ04c000 taskÈ0219d0) Oct 14 16:09:27 pototogorri kernel: Stack: ddeca290 dd3f7800 c204dc80 c0268a62 dd3f7800 00010000 d1a8873c 00000000 Oct 14 16:09:27 pototogorri kernel: 000005c8 ddb15800 0000000a 00000000 00000000 ffffffff dd3f7800 ddb15800 Oct 14 16:09:27 pototogorri kernel: 00000010 dce34a40 00000048 c204dcb0 c204dcfc c0262297 dce34a40 ddeca280 Oct 14 16:09:27 pototogorri kernel: Call Trace: Oct 14 16:09:27 pototogorri kernel: [<c010707b>] show_stack+0x9b/0xb0 Oct 14 16:09:27 pototogorri kernel: [<c01071cb>] show_registers+0x11b/0x180 Oct 14 16:09:27 pototogorri kernel: [<c0107310>] die+0x50/0xb0 Oct 14 16:09:27 pototogorri kernel: [<c0117280>] do_page_fault+0x330/0x5b8 Oct 14 16:09:27 pototogorri kernel: [<c0106cbd>] error_code+0x2d/0x40 Oct 14 16:09:27 pototogorri kernel: [<c0268a62>] tc_modify_qdisc+0x102/0x450 Oct 14 16:09:27 pototogorri kernel: [<c0262297>] rtnetlink_rcv+0x347/0x3b0 Oct 14 16:09:27 pototogorri kernel: [<c026c3c4>] netlink_data_ready+0x54/0x60 Oct 14 16:09:27 pototogorri kernel: [<c026baca>] netlink_sendskb+0x6a/0x90 Oct 14 16:09:27 pototogorri kernel: [<c026c0a9>] netlink_sendmsg+0x1f9/0x2c0 Oct 14 16:09:27 pototogorri kernel: [<c0253078>] sock_sendmsg+0x88/0xb0 Oct 14 16:09:27 pototogorri kernel: [<c0254696>] sys_sendmsg+0x196/0x210 Oct 14 16:09:27 pototogorri kernel: [<c0254960>] sys_socketcall+0x80/0x1a0 Oct 14 16:09:27 pototogorri kernel: [<c0105c79>] sysenter_past_esp+0x52/0x79 Oct 14 16:09:27 pototogorri kernel: Code: 8b 40 2c 0f 18 00 90 39 ca 75 e6 31 c0 5b 5e 5d c3 8d 74 26
Oct 14 17:23:30 pototogorri kernel: HTB: quantum of class 10481 is small. Consider r2q change. Oct 14 17:23:30 pototogorri kernel: HTB: quantum of class 10482 is small. Consider r2q change. Oct 14 17:23:30 pototogorri kernel: HTB: quantum of class 10483 is small. Consider r2q change. Oct 14 17:23:30 pototogorri kernel: HTB: quantum of class 11041 is small. Consider r2q change. Oct 14 17:23:30 pototogorri kernel: HTB: quantum of class 11042 is small. Consider r2q change.
Servicio ofrecido por www.systemwifi.com
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Re: [LARTC] HTB
In reply to George TsuladzeQuoted 10 lines · sistemas
Hi all
I'm new in this list and i hope to lear and to help if possible.
But firt i need help :-(
I have this messege in my syslog when my classes and qdiscs goes down.
Can any one know what does it mean?
I used to have an Oops an awful lot like that. I upgraded to 2.6.9-rc3 and it resolved the problem. Yours could be something else, though.
What tc configuration are you using? What's the simplest possible configuration you can create that consistently reproduces the problem?
What specifically did you do to trigger this problem, if you know?
Thanks.
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
buddies,
i am newbie to band control.. i have a linux box (as a router, NATing,) sharing internet
----internet----------eth0-[linux.box]-eth1----------my.lan
wan = adsl 600
lan = about 20 users
my problem is that due the contract i cannot block users from my lan from downloading anything, so they can use kazaa (argghh), edonkey(argghhhhh), emule(arghhhhhh), soulseek(arghjhhhh) etc etc etc,
so,
I want to know if using htb i can make that users that uses browsers (port 80) have priority then users that uses port (110 and 25) , then rest of the ports..... as if i could have such thing:
600kbit -------- 50% for port 80
30% for port 25 and 110
20% for the rest
this way no user can complain that cannot access his internet banking, checking his emails and other thing that are essentials...
if it is possible (with htb) or any other method, please tell me a direction for me to go..
really thanks
james
hey ja,
do you have a small script example to show me ? ... i am new to those thing.. wanna study examples to understand how things works... tried reading some docs but my english is poor so, i could understand very few..
thanks
----- Original Message -----
From: ja
To: James Lista ; [email protected]
Sent: Sunday, October 17, 2004 10:53 AM
Subject: Re: [LARTC] htb
This is no good cause for example bittorent can download on port 80 :D. So the best way is create classes with ceil parameter for example 128kbit to ensure relability for every user and limit number of connections to 50-80 per user. This the best (i can get a word grr....- you know) if you dont want to block p2p.
----- Original Message -----
From: James Lista
To: [email protected]
Sent: Sunday, October 17, 2004 2:42 PM
Subject: [LARTC] htb
buddies,
i am newbie to band control.. i have a linux box (as a router, NATing,) sharing internet
----internet----------eth0-[linux.box]-eth1----------my.lan
wan = adsl 600
lan = about 20 users
my problem is that due the contract i cannot block users from my lan from downloading anything, so they can use kazaa (argghh), edonkey(argghhhhh), emule(arghhhhhh), soulseek(arghjhhhh) etc etc etc,
so,
I want to know if using htb i can make that users that uses browsers (port 80) have priority then users that uses port (110 and 25) , then rest of the ports..... as if i could have such thing:
600kbit -------- 50% for port 80
30% for port 25 and 110 20% for the rest
this way no user can complain that cannot access his internet banking, checking his emails and other thing that are essentials...
if it is possible (with htb) or any other method, please tell me a direction for me to go..
really thanks
james
Am Sunday 17 October 2004 14:42 schrieb James Lista:
Quoted 3 lines
600kbit ------------ 50% for port 80
30% for port 25 and 110
20% for the rest
Sure, that's possible. That's one 600kbit class with three child classes.
However, there may be many other ports besides 25, 80, and 110 that deserve prioritizing. Throwing them in the same class as all filesharing traffic could make things even worse than before.
Then there's the problem that many filesharing protocols can work on any port, so your users could just move to one of the prioritized ports and take all the bandwidth again.
That's some of the reasons why I never bothered with prioritizing ports on a global basis. Consider using ipp2p or l7-filter for a more reliable way for detecting P2P traffic.
No matter how you look at it, 600kbit for 20 users is a bit slow. Even without P2P traffic, if all of them surf the web at the same time, they won't be very happy with the speed.
Besides traffic shaping, you should do anything possible to reduce load. Cache DNS queries, provide a HTTP proxy, probably squid. Make sure that you can't be flooded from the outside. Stuff like that.
HTH
Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
andreas,
having one class per user seems cool... please buddy, have a sample script of that ?
so, if i have 600kbit / 7 = 86kbit for each, is it that ??? if so, is it too few for a single user ?
about something that i read that say "borrowing", when a user borrow his spare band to a "vampire", when will he gets it back when he needs it...?
thanks again
----- Original Message -----
From: "Andreas Klauer" <[email protected]>
To: <[email protected]>
Sent: Sunday, October 17, 2004 11:20 AM
Subject: Re: [LARTC] htb
Quoted 16 lines
Am Sunday 17 October 2004 15:02 schrieb James Lista:
Quoted 3 lines
and about that you say take a look at ipp2p or l7-filter: errr, can they identify when a user changed edonkey or any other p2p default port and limit such packet even so ????
They try to. I'm using IPP2P and it works okay for me.
Although my shaping setup is a little different from what you want to do. I've got one class per user, so everyone gets the same share of bandwidth. This way it doesn't matter what kind of traffic a user generates, as it doesn't influence the others.
Prioritization is then done within the user classes, the only effect of that is that a user can still have a lag free SSH connection while he's downloading stuff at the same time.
Quoted 9 lines
So in my setup, if the user finds a way to trick the prioritization settings, he's only tricking himself, because he can't escape his user class :)
Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
This is no good cause for example bittorent can download on port 80 :D. So the best way is create classes with ceil parameter for example 128kbit to ensure relability for every user and limit number of connections to 50-80 per user. This the best (i can get a word grr....- you know) if you dont want to block p2p.
----- Original Message -----
From: James Lista
To: [email protected]
Sent: Sunday, October 17, 2004 2:42 PM
Subject: [LARTC] htb
buddies,
i am newbie to band control.. i have a linux box (as a router, NATing,) sharing internet
----internet----------eth0-[linux.box]-eth1----------my.lan
wan = adsl 600
lan = about 20 users
my problem is that due the contract i cannot block users from my lan from downloading anything, so they can use kazaa (argghh), edonkey(argghhhhh), emule(arghhhhhh), soulseek(arghjhhhh) etc etc etc,
so,
I want to know if using htb i can make that users that uses browsers (port 80) have priority then users that uses port (110 and 25) , then rest of the ports..... as if i could have such thing:
600kbit -------- 50% for port 80
30% for port 25 and 110
20% for the rest
this way no user can complain that cannot access his internet banking, checking his emails and other thing that are essentials...
if it is possible (with htb) or any other method, please tell me a direction for me to go..
really thanks
james
andreas
first thanks for the answer and the advices.
well. let me say some things: inspite of saying that i have 600kbit for 20 users, it is really rare to have more than 7 at the same time
and about that you say take a look at ipp2p or l7-filter: errr, can they identify when a user changed edonkey or any other p2p default port and limit such packet even so ????
----- Original Message -----
From: "Andreas Klauer" <[email protected]>
To: <[email protected]>
Sent: Sunday, October 17, 2004 10:19 AM
Subject: Re: [LARTC] htb
Quoted 8 lines
Am Sunday 17 October 2004 14:42 schrieb James Lista:
Quoted 3 lines
600kbit ------------ 50% for port 80
30% for port 25 and 110
20% for the restSure, that's possible. That's one 600kbit class with three child classes.
However, there may be many other ports besides 25, 80, and 110 that
deserve
Quoted 19 lines
prioritizing. Throwing them in the same class as all filesharing traffic could make things even worse than before.
Then there's the problem that many filesharing protocols can work on any port, so your users could just move to one of the prioritized ports and take all the bandwidth again.
That's some of the reasons why I never bothered with prioritizing ports on a global basis. Consider using ipp2p or l7-filter for a more reliable way for detecting P2P traffic.
No matter how you look at it, 600kbit for 20 users is a bit slow. Even without P2P traffic, if all of them surf the web at the same time, they won't be very happy with the speed.
Besides traffic shaping, you should do anything possible to reduce load. Cache DNS queries, provide a HTTP proxy, probably squid. Make sure that you can't be flooded from the outside. Stuff like that.
Quoted 6 lines
HTH
Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Am Sunday 17 October 2004 15:02 schrieb James Lista:
Quoted 3 lines
and about that you say take a look at ipp2p or l7-filter: errr, can they identify when a user changed edonkey or any other p2p default port and limit such packet even so ????
They try to. I'm using IPP2P and it works okay for me.
Although my shaping setup is a little different from what you want to do. I've got one class per user, so everyone gets the same share of bandwidth. This way it doesn't matter what kind of traffic a user generates, as it doesn't influence the others.
Prioritization is then done within the user classes, the only effect of that is that a user can still have a lag free SSH connection while he's downloading stuff at the same time.
So in my setup, if the user finds a way to trick the prioritization settings, he's only tricking himself, because he can't escape his user class :)
Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
Am Sunday 17 October 2004 14:08 schrieb James Lista:
Quoted 1 line
do you have a small script example to show me ? ...
I don't know about the "small" part...
My own script: http://www.metamorpher.de/fairnat/
HTH
Andreas
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] HTB
In reply to George TsuladzeHello folks,
I´m a fully Beginner in Linux and Traffic Control.
I have a lot of Problems to realize the following Scenario(I need it for my
scholastics):
2 customers share one 2Mbit link. The packets of the customers are coming
on
the interface with a NAT Adress each. Each of the customers should use only
1Mbit of the Line.
192.168.0.1 - - -
customer1 eth0 | | eth1 customer1
-----------| |--------------
customer2 2Mbit| | 2Mbit customer2
192.168.1.99 - - - I think I have to use 2 Scripts, one for each interface (on every side).
I have written a small skript, but i´m unsteady if it works. It would be very nice, if you can take a look at it and give me some hints.
Greetings
Marcus Schäfer
############################################################################Traffic
Control
###########################################################################
#! /bin/sh
#variables
ext_dev_1=eth0
bw=1Mbps
#####root qdisc for eth0
tc qdisc add dev $ext_dev_1 root handle 1: htb
#####root class for customer 1 on eth0
tc class add dev $ext_dev_1 parent 1: classid 1:1 htb rate $bw ceil $bw
prio
0
##### 3 classes for customer 1 on eth0
tc class add dev $ext_dev_1 parent 1:1 classid 1:2 htb rate 450kbps ceil
$bw
prio 0
tc class add dev $ext_dev_1 parent 1:1 classid 1:3 htb rate 450kbps ceil
$bw
prio 1
tc class add dev $ext_dev_1 parent 1:1 classid 1:4 htb rate 100kbps ceil
$bw
prio 2
#####root class for customer 2 on eth0
tc class add dev $ext_dev_1 parent 1: classid 2:1 htb rate $bw ceil $bw
prio
0
#####3 classes for customer 2 on eth0
tc class add dev $ext_dev_1 parent 1:1 classid 2:2 htb rate 450kbps ceil
$bw
prio 0
tc class add dev $ext_dev_1 parent 1:1 classid 2:3 htb rate 450kbps ceil
$bw
prio 1
tc class add dev $ext_dev_1 parent 1:1 classid 2:4 htb rate 100kbps ceil
$bw
prio 2
#####Filters which directs packets marked with iptables in the right
classes
#####Filters for customer 1 on eth0
tc filter add dev ext_dev_1 parent 1: prio 0 protocol ip handle 1 fw flowid
1:2
tc filter add dev ext_dev_1 parent 1: prio 1 protocol ip handle 2 fw flowid
1:3
tc filter add dev ext_dev_1 parent 1: prio 2 protocol ip handle 3 fw flowid
1:4
#####Filters for customer 2 on eth0
tc filter add dev ext_dev_1 parent 1: prio 0 protocol ip handle 4 fw flowid
2:2
tc filter add dev ext_dev_1 parent 1: prio 1 protocol ip handle 5 fw flowid
2:3
tc filter add dev ext_dev_1 parent 1: prio 1 protocol ip handle 6 fw flowid
2:4
############################################################################
iptables
###########################################################################
$ipt=/sbin/iptables
########### mark packets for customer 1 on eth0 ###########################
# mark packets with 1 which come from 192.168.0.1 and have a source port #of 80
$ipt -t mangle -A FORWARD -s 192.168.0.1 -p tcp --sport 80 -j MARK --set-mark 1
# mark packets with 2 which come from 192.168.0.1 and have a source port #of 22
$ipt -t mangle -A FORWARD -s 192.168.0.1 -p tcp --sport 22 -j MARK --set-mark 2
######## mark packets for customer 2 on eth0 ##############################
# mark packets with 4 which come from 192.168.1.99 and have a source port #of 80
$ipt -t mangle -A FORWARD -s 192.168.1.99 -p tcp --sport 80 -j MARK --set-mark 4
# mark packets with 5 which come from 192.168.1.99 and have a source port #of 22
$ipt -t mangle -A FORWARD -s 192.168.1.99 -p tcp --sport 22 -j MARK --set-mark 5
######## mark unmatched packets ###########################################
#mark packets with 3 which come from 192.168.0.1
$ipt -t mangle -A FORWARD -s 192.168.0.1 -j MARK --set-mark 3
#mark packets with 6 which come from 192.168.1.99
$ipt -t mangle -A FORWARD -s 192.168.1.99 -j MARK --set-mark 6
Signature · 5 lines
NEU +++ DSL Komplett von GMX +++ http://www.gmx.net/de/go/dsl GMX DSL-Netzanschluss + Tarif zum supergünstigen Komplett-Preis! _______________________________________________ LARTC mailing list / [email protected] http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
[LARTC] HTB
In reply to George TsuladzeWhat exactly happens if the sum of the children classes rate is bigger than the parent's?
What if the majority of these classes are using less than the minimum rate established (eg. 0kbps)?
Signature · 7 lines
Marco Casaroli SapucaiNet Telecom +55 35 34712377 ext 5 _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
Re: [LARTC] HTB
In reply to George TsuladzeMarco Aurelio ha scritto:
Quoted 2 lines
What exactly happens if the sum of the children classes rate is bigger than the parent's?
HTB will assign to the leaf the rate regardeless of the value of the parent's rate.
The parent's rate is used only to compute how much bandwith must be allocated to the leaf's ceil.
Quoted 2 lines
What if the majority of these classes are using less than the minimum rate established (eg. 0kbps)?
Signature · 10 lines
********************************************************************** Marco Innocenti Gruppo Infrastruttura e Sicurezza CINECA phone:+39 0516171553 / fax:+39 0516132198 Via Magnanelli 6/3 e-mail: [email protected] 40033 Casalecchio di Reno Bologna (Italia) ********************************************************************** _______________________________________________ LARTC mailing list [email protected] http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc